﻿using GameStructure.Contracts;
using GameStructure.Core;
using GameStructure.Types;

namespace GameStructure.GaneState
{
    public class RectangleIntersectionState : IGameObject
    {
        private readonly Input _input;
        private readonly Rectangle _rectangle = new Rectangle(new Vector(0,0,0), new Vector(200,200,0));

        public RectangleIntersectionState(Input input)
        {
            _input = input;
        }

        public void Update(double elapsedTime)
        {
            _rectangle.Color = _rectangle.Intersects(_input.MousePosition) ? new Color(1, 0, 0, 1) : new Color(1, 1, 1, 1);
        }

        public void Render()
        {
            _rectangle.Render();
        }
    }
}